package com.example.gameex2;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

public class GraphicObject {
	private Bitmap m_bitmap;
	protected int m_x;
	protected int m_y;
	
	public GraphicObject(Bitmap bitmap)
	{
		m_bitmap = bitmap;
		m_x = 0;
		m_y = 0;		
	}
	
	public void Draw(Canvas canvas)
	{
		canvas.drawBitmap(m_bitmap, m_x, m_y, null);
	}

	public void SetPosition(int x, int y)
	{
		m_x = x;
		m_y = y;
	}
	
	public int GetX()
	{
		return m_x;
	}
	
	public int GetY()
	{
		return m_y;
	}
	
	public int GetCenterX()
	{
		return m_bitmap.getWidth()/2;
	}
	
	public int GetCenterY()
	{
		return m_bitmap.getHeight()/2;
	}
	
	public Bitmap GetBitmap()
	{
		return m_bitmap;
	}
}
